blog-banner

How Tweeq Built a Digital Banking Platform using Go, CockroachDB & Oracle Cloud

Last edited on December 14, 2023

0 minute read

    When was the last time you carried cash? If you’re anything like alot of us, it has probably been awhile. The whole world is rapidly becoming cashless, actually. Case in point: Saudi Arabia’s government has a vision for a cashless society and is targeting 70% of all transactions to be cashless by 2025. Below, we profile how Tweeq, a Saudi fintech startup founded in 2020, is meeting this mandate by building a highly scalable and flexible payments platform from scratch.

    Tweeq enables customers to manage their money, make transfers, shop, pay bills, and withdraw cash in a seamless and safe way. Tweeq’s swift entry into the market (and therefore the creation of the digital payments market in Saudi Arabia) is a result of both the Kingdom’s cashless mandate and its goal of creating and supporting unicorn tech companies. Tweeq has achieved the distinction of being the first nonbank payment service provider licensed to operate in Saudi Arabia.

    Tweeq’s Co-Founder and CTO Abdulaziz AlMalki lays out how a modern payments platform differs from legacy platforms: “We have ambitions to revolutionize the payments scene in the region, and this requires a different engineering approach from what traditional financial institutions do. Our systems must be scalable to millions of users, available 24/7, very easy to change, and extensible to adapt to our customers’ needs. Our engineering team should be able to iterate quickly to serve our customers, all while maintaining high quality products.”

    A fintech-friendly startup stackCopy Icon

    These goals for the Tweeq platform have translated into several key architectural and technology principles. Design-wise, they “try to be minimalist” in their tool selection and architectural decisions. Their tech stack is comprised of what the team describes as “no-brainer” solutions: technologies the team could quickly on-board into the platform, hire for, and maintain.. In addition, they aim to be cloud-agnostic, which means they do not rely on cloud provider-specific tools. Some of their ultimate “no-brainer” tech choices include:

    • Go.

      Golang

      was one of the first technology choices made by Tweeq. They wanted a solid and reliable basis for their microservice backend and, while Go expertise isn’t widespread in Saudi, the ease with which they could train people, paired with the ease of development, qualified it as a no-brainer choice.

    • CockroachDB.

      Distributed SQL

      was another no-brainer technology choice for Tweeq. Given the critical importance of accuracy, correctness, and resilience within their industry, the platform needed a database that would provide these guarantees whilst still allowing them to scale. Initially the team considered manually sharding and scaling a Postgres database, but they quickly realized that the heavy lifting of building and maintaining such a database would detract from their primary business focus.

    • Temporal

      is an orchestration platform for microservices which allows developers to build reliable and reproducible units of application logic, without having to worry about retries or execution order etc. The Tweeq team describes their payments platform as “a series of robust workflows” so it’s no surprise that Temporal was another no-brainer technology choice.

    • gRPC

      is a remote procedure call (RPC) framework that communicates using Protobuf over HTTP/2. It not only allows Tweeq’s services to communicate efficiently, but has also let them bootstrap UIs.

    • Bazel

      is a performant open source build tool that allows the Tweeq team to create reproducible builds from their code. It originates from Google, where it is used to build Docs, Mail, Search, and that vast majority of Google’s other products.

    Complying with the PDPLCopy Icon

    While Tweeq has wide latitude to make many technology and architectural decisions, the regulatory environment in its home country has a major impact on the decision making process. Saudi Arabia’s Personal Data Protection Law (PDPL) is a comprehensive data privacy regulation that is similar to GDPR. Companies operating within Saudi Arabia need to store and process customer data within Saudi Arabia.

    Since hyperscaler (AWS, Azure, GCP) presence has not quite reached their region, Tweeq decided to deploy a hybrid infrastructure using Oracle Cloud Infrastructure and an on-premise data center provider. This satisfied PDPL requirements, and also helps the platform be resilient to a host of failure scenarios.

    Given the cloud-agnostic nature of their application and database architecture, the Tweeq team will have the flexibility to choose of any (or all) of the hyperscalers as they become available in the region, which will allow them to build even more scale and resilience into their platform.

    What’s next for Tweeq? The company is preparing to expand across the Middle East and North Africa (MENA) and is also building additional services into its platform. Both of these initiatives will benefit from the scale, flexibility, and reliability the team has baked into its platform. Making sure that their customers never need carry cash again.

    go
    fintech
    payment system
    data compliance regulation
    gdpr
    customer
    customer stories